package com.yaorange.container;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 *  权限容器
 */
@Component
public class PermissionContainer {

    private static final Map<String, Set<String>> PERMISSION_CONTAINER = new HashMap<>();

    /**
     *  放入权限
     * @param key
     * @param value
     */
    public void putPermission(String key, Set<String> value){
        PERMISSION_CONTAINER.put(key, value);
    }

    /**
     *  取出权限
     * @param key
     * @return
     */
    public Set<String> getPermission(String key){
        return PERMISSION_CONTAINER.get(key);
    }

}
